package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.WorkingStepMapper;
import com.ly.heart.domain.WorkingStepEntity;


import javax.annotation.Resource;
import com.ly.heart.service.IWorkingStepService;

/**
 * 施工工序设置Service业务层处理
 * 
 * @author wutao
 * @date 2024-06-10
 */
@Service
public class WorkingStepServiceImpl extends ServiceImpl<WorkingStepMapper,WorkingStepEntity> implements IWorkingStepService {

    @Resource
    private WorkingStepMapper workingStepMapper;

    /**
     * 查询施工工序设置
     * 
     * @param id 施工工序设置ID
     * @return 施工工序设置
     */
    @Override
    public WorkingStepEntity selectWorkingStepById(String id)
    {
        return workingStepMapper.selectWorkingStepById(id);
    }

    /**
     * 查询施工工序设置列表
     * 
     * @param workingStep 施工工序设置
     * @return 施工工序设置
     */
    @Override
    public List<WorkingStepEntity> selectWorkingStepList(WorkingStepEntity workingStep)
    {
        return workingStepMapper.selectWorkingStepList(workingStep);
    }

    /**
     * 新增施工工序设置
     * 
     * @param workingStep 施工工序设置
     * @return 结果
     */
    @Override
    public int insertWorkingStep(WorkingStepEntity workingStep)
    {
        workingStep.setCreateTime(DateUtils.getNowDate());
        workingStep.setId(SnowflakeIdWorker.getInstance().nextStringId());
        return workingStepMapper.insertWorkingStep(workingStep);
    }

    /**
     * 修改施工工序设置
     * 
     * @param workingStep 施工工序设置
     * @return 结果
     */
    @Override
    public int updateWorkingStep(WorkingStepEntity workingStep)
    {
        workingStep.setUpdateTime(DateUtils.getNowDate());
        return workingStepMapper.updateWorkingStep(workingStep);
    }

    /**
     * 批量删除施工工序设置
     * 
     * @param ids 需要删除的施工工序设置ID
     * @return 结果
     */
    @Override
    public int deleteWorkingStepByIds(String[] ids)
    {
        return workingStepMapper.deleteWorkingStepByIds(ids);
    }

    /**
     * 删除施工工序设置信息
     * 
     * @param id 施工工序设置ID
     * @return 结果
     */
    @Override
    public int deleteWorkingStepById(String id)
    {
        return workingStepMapper.deleteWorkingStepById(id);
    }
}
